/* 
 * File:   BGCube.cpp
 * Author: Davit Vardanyan
 * 
 * Created on January 14, 2013, 2:48 AM
 */

#include "BGCube.h"
#include <iostream>
using namespace std;

BGCube::BGCube() {
}

BGCube::BGCube(const BGCube& orig) {
}

BGCube::~BGCube() {
}

void BGCube::draw(GLuint texture)
{
    glPushMatrix();
    glBindTexture(GL_TEXTURE_2D, texture);
    glColor4f(1.0, 1.0, 1.0, 1.0);
    glTranslatef(position.x, position.y, 0.0);
    glBegin(GL_QUADS);
        glTexCoord2f(0.0, 0.0);
        glVertex3f(-radius, -radius, 2.0);
        glTexCoord2f(1.0, 0.0);
        glVertex3f(radius, -radius, 2.0);
        glTexCoord2f(1.0, 1.0);
        glVertex3f(radius, radius, 2.0);
        glTexCoord2f(0.0, 1.0);
        glVertex3f(-radius, radius, 2.0);
    glEnd();
    glPopMatrix();
}

void BGCube::createCube(int t, float r)
{
        tag = t;
        radius = r;
}

BGPoint BGCube::getPosition()
{
    return position;
}

void BGCube::setPosition(BGPoint point)
{
    position.x = point.x;
    position.y = point.y;
}

void BGCube::setRadius(float r)
{
    radius = r;
}

float BGCube::getRadius()
{
    return radius;
}

void BGCube::setTag(int t)
{
    tag = t;
}

int BGCube::getTag()
{
    return tag;
}
